home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2005 October / PCWOCT05.iso / Software / FromTheMag / Ant Movie Catalog 3.5.0.2 / amc_install.exe / {app} / Scripts / Cinemasie (FR).ifs < prev    next >
Text File  |  2005-05-23  |  22KB  |  578 lines

  1. (***************************************************
  2.  
  3. Ant Movie Catalog importation script
  4. www.antp.be/software/moviecatalog/
  5.  
  6. [Infos]
  7. Authors=ScorEpioN
  8. Title=Cinemasie.com
  9. Description=Recherche de films asiatiques, staff, synopsis et images
  10. Site=http://www.cinemasie.com
  11. Language=EN,FR
  12. Version=23 du 23/05/2005
  13. Requires=3.5
  14. Comments=Ce script nΘcessite le fichier ScorEpioNCommonScript.pas|.==.| :   ' ( ( ( ( /\ |  "==()))))):     ⌐ ScorEpioN ⌐|       ( ( ( ( \_/
  15. License=This program is free software; you can redistribute it and/or modify it under the  terms of the GNU General Public License as published by the Free Software Foundation;  either version 2 of the License, or (at your option) any later version. |
  16. GetInfo=1
  17.  
  18. [Options]
  19. Mise α jour=1|1|0=Oui|1=Non
  20. Langue (Franτais/English)=0|0|0=Franτais|1=English
  21. Type de Lancement=0|0|0=Demande le titre avant de lancer le script|1=Ne demande pas le titre avant de lancer le script|2=Cherche le meilleur rΘsultat sans confirmation|3=Lancement automatique sur l'adresse web
  22. Casse Choisie=3|3|0=Titre en minuscule|1=Titre en majuscule|2=PremiΦre lettre du titre en majuscule|3=PremiΦre lettre de chaque mot du titre en majuscule
  23. Titre en double=2|2|0=Garde les titres originaux et traduits mΩme identiques|1=Garde les titres originaux si identiques|2=Garde les titres traduits si identiques
  24. Choix titres originaux=0|0|0=Titre Original|1=Titre Anglais
  25. Recherche sur le titre=0|0|0=Traduit|1=Original
  26. Fichier de log=1|1|0=Oui|1=Non
  27.  
  28. ***************************************************)
  29.  
  30. program CINEMASIE_SEARCH;
  31. uses
  32.   ScorEpioNCommonScript;
  33. const
  34.   VersionScript = '23 du 23/05/2005';
  35.   NomScript = 'CINEMASIE';
  36.   urlDomain = 'cinemasie.com';
  37.   urlBase   = 'http://www.cinemasie.com';
  38.   urlBaseFR = 'http://www.cinemasie.com/fr';
  39.   urlBaseUS = 'http://www.cinemasie.com/en';
  40.   urlSearch = '/listes/recherche/recherche.php?texte=';
  41.   urlImage  = '/visuels/affichettes/';
  42.   urlImage2 = '/visuels/jaqsdvd/';
  43.  
  44. var
  45.   MovieName, NomFilm : string;
  46.   i, premiereExecution : Integer;
  47.   listeResultat: TStringList;
  48.   listeFR, listeUS : array of string;
  49.  
  50. //------------------------------------------------------------------------------
  51. // URL EN FRANCAIS OU EN ANGLAIS
  52. //------------------------------------------------------------------------------
  53.  
  54. function urlBaseFRUS() : string;
  55. begin
  56.   if (GetOption('Langue (Franτais/English)') = 0) then
  57.     result := urlBaseFR
  58.   else if (GetOption('Langue (Franτais/English)') = 1) then
  59.     result := urlBaseUS;
  60. end;
  61.  
  62. //------------------------------------------------------------------------------
  63. // RETOURNE ELEMENT EN FR OU EN US
  64. //------------------------------------------------------------------------------
  65.  
  66. function retourneElement(j : Integer) : string;
  67. begin
  68.   if (GetOption('Langue (Franτais/English)') = 0) then
  69.     result := listeFR[j]
  70.   else if (GetOption('Langue (Franτais/English)') = 1) then
  71.     result := listeUS[j];
  72. end;
  73.  
  74. //------------------------------------------------------------------------------
  75. // ANALYSE DE LA PAGE DE RECHERCHES
  76. //------------------------------------------------------------------------------
  77.  
  78. procedure AnalyzePage(Address: string);
  79. var
  80.   Line, annee, titre, adresse : String;
  81.   StartPos, EndPos : Integer;
  82. begin
  83. // Charge la page
  84.   Line := GetPage(Address);
  85. // Traduction des champs
  86.   SetArrayLength(listeFR,6);
  87.   SetArrayLength(listeUS,6);
  88.   listeFR[0] := 'pas de rΘsultats avec le texte entrΘ';
  89.   listeUS[0] := 'There is no result for the text you have provided.';
  90.   listeFR[1] := 'Aucun film trouvΘ pour : ';
  91.   listeUS[1] := 'No result : ';
  92.   listeFR[2] := 'rΘsultat(s) exact(s)';
  93.   listeUS[2] := 'accurate Results';
  94.   listeFR[3] := 'annΘe';
  95.   listeUS[3] := 'year';
  96.   listeFR[4] := 'titres les plus demandΘs';
  97.   listeUS[4] := 'all the results';
  98.   listeFR[5] := 'tous les titres';
  99.   listeUS[5] := 'all the titles';
  100. //teste si il y a des films trouvΘs
  101.   if Pos(retourneElement(0), Line) <> 0 then
  102.   begin
  103.     if (GetOption('Type de Lancement') = 0) then
  104.        showmessage(retourneElement(1) + MovieName)
  105.     else
  106.         SetField(fieldChecked, '');
  107.     exit;
  108.   end else
  109.   begin
  110.     listeResultat := TStringList.Create;
  111. // Titres exacts
  112.     if pos(retourneElement(2),Line) <> 0 then
  113.     begin
  114.       StartPos := pos(retourneElement(2), Line);
  115.       delete(Line, 1, StartPos-1);
  116.       StartPos := pos('"indpic">', Line);
  117.       delete(Line, 1, StartPos-1);
  118.       repeat
  119.         StartPos := pos('"indpic">', Line);
  120.         delete(Line, 1, StartPos-1);
  121.         titre := findInfo('"indpic">', '</a>', Line,'0');
  122.         adresse := urlBaseFRUS()+findInfo('<a href="', '"', Line,'0');
  123.         annee := findInfo(retourneElement(3)+'</b></td><td>', '</td>', Line,'0');
  124.         listeResultat.Add(annee+'|'+titre+'|'+adresse);
  125.         delete(Line, 1, length('"indpic">'));
  126.         EndPos := pos('</table>', Line);
  127.         StartPos := pos('"indpic">', Line);
  128.       until (StartPos > EndPos);
  129.     end;
  130. // Autres titres
  131.     if pos(retourneElement(4),Line) <> 0 then
  132.     begin
  133.       StartPos := pos(retourneElement(4), Line);
  134.       delete(Line, 1, StartPos-1);
  135.       StartPos := pos('"indpic">', Line);
  136.       delete(Line, 1, StartPos-1);
  137.       repeat
  138.         StartPos := pos('"indpic">', Line);
  139.         delete(Line, 1, StartPos-1);
  140.         annee := findInfo('"indpic">', '</td>', Line,'0');
  141.         adresse := urlBaseFRUS()+findInfo('<a href="', '"', Line,'0');
  142.         titre := findInfo('<td>', '</a>', Line,'0');
  143.         if (GetOption('Langue (Franτais/English)') = 0)then
  144.           titre := titre + ' ('+findInfo('</a></td>', '</a>', Line,'0')+')';
  145.         titre := StringReplace(titre , '         ', '');
  146.         titre := StringReplace(titre , '    ', '');
  147.         titre := StringReplace(titre , '()', '');
  148.         listeResultat.Add(annee+'|'+titre+'|'+adresse);
  149.         delete(Line, 1, length('"indpic">'));
  150.         EndPos := pos('</table>', Line);
  151.         StartPos := pos('"indpic">', Line);
  152.       until (StartPos =0);
  153.     end;
  154. // Tous les titres
  155.     if pos(retourneElement(5),Line) <> 0 then
  156.     begin
  157.       StartPos := pos('tous les titres', Line);
  158.       delete(Line, 1, StartPos-1);
  159.       StartPos := pos('"indpic">', Line);
  160.       delete(Line, 1, StartPos-1);
  161.       repeat
  162.         StartPos := pos('"indpic">', Line);
  163.         delete(Line, 1, StartPos-1);
  164.         annee := findInfo('"indpic">', '</td>', Line,'0');
  165.         adresse := urlBaseFRUS()+findInfo('<a href="', '"', Line,'0');
  166.         titre := findInfo('<td>', '</a>', Line,'0');
  167.         if (GetOption('Langue (Franτais/English)') = 0)then
  168.           titre := titre + ' ('+findInfo('</a></td>', '</a>', Line,'0')+')';
  169.         titre := StringReplace(titre , '         ', '');
  170.         titre := StringReplace(titre , '    ', '');
  171.         titre := StringReplace(titre , '()', '');
  172.         listeResultat.Add(annee+'|'+titre+'|'+adresse);
  173.         delete(Line, 1, length('"indpic">'));
  174.         EndPos := pos('</table>', Line);
  175.         StartPos := pos('"indpic">', Line);
  176.       until (StartPos = 0);
  177.     end;
  178. // CrΘation de la liste de rΘsultats
  179.     afficheResultat(MovieName);
  180.   end;
  181. end;
  182.  
  183. //------------------------------------------------------------------------------
  184. // CREATION DE LA LISTE DE RESULTAT
  185. //------------------------------------------------------------------------------
  186.  
  187. procedure afficheResultat(title : String);
  188. var
  189.    StartPos : Integer;
  190.    Texte, couple, annee, complement, titre, adresse : String;
  191. begin
  192.   if (GetOption('Type de Lancement') = 0) or (GetOption('Type de Lancement') = 1) then
  193.   begin
  194.    PickTreeClear;
  195.    if (GetOption('Langue (Franτais/English)') = 0) then
  196.     Texte := 'Films trouvΘs pour '
  197.    else if (GetOption('Langue (Franτais/English)') = 1) then
  198.     Texte := 'Movies founds for ';
  199.    PickTreeAdd(Texte + title + ' :', '');
  200.    for i:=0 to listeResultat.Count-1 do
  201.    begin
  202.      couple := listeResultat.GetString(i);
  203.      annee := copy(couple,0,pos('|',couple)-1);
  204.      delete(couple, 1, length(annee)+1);
  205.      titre := copy(couple,0,pos('|',couple)-1);
  206.      delete(couple, 1, length(titre)+1);
  207.      HTMLDecode(titre);
  208.      adresse := copy(couple,0,length(couple));
  209.      delete(couple, 1, length(adresse)+1);
  210.      PickTreeAdd('['+annee+'] '+titre, adresse);
  211.    end;
  212.  
  213.    if listeResultat.Count = 1 then
  214.    begin
  215.      AnalysePageFilm(adresse);
  216.      exit;
  217.    end;
  218.  
  219.     begin
  220.       if PickTreeExec(adresse)=true then
  221.       begin
  222.           AnalysePageFilm(adresse);
  223.       end;
  224.     end;
  225.   end else if (GetOption('Type de Lancement') = 2) then
  226.   begin
  227.    if listeResultat.Count = 1 then
  228.    begin
  229.      couple := listeResultat.GetString(0);
  230.      annee := copy(couple,0,pos('|',couple)-1);
  231.      delete(couple, 1, length(annee)+1);
  232.      titre := copy(couple,0,pos('|',couple)-1);
  233.      delete(couple, 1, length(titre)+1);
  234.      HTMLDecode(titre);
  235.      adresse := copy(couple,0,length(couple));
  236.      delete(couple, 1, length(adresse)+1);
  237.      AnalysePageFilm(adresse);
  238.      exit;
  239.    end else
  240.    begin
  241.      trouveTitle(title);
  242.    end;
  243.   end;
  244. end;
  245.  
  246. //------------------------------------------------------------------------------
  247. // ANALYSE DE LA PAGE DU FILM
  248. //------------------------------------------------------------------------------
  249.  
  250. procedure AnalysePageFilm(Address: string);
  251. var
  252.    Value, Value2, Line, titre_original, titre_anglais, autre_titre, les_titres, Note1, Note2 : String;
  253.    StartPos : Integer;
  254.   
  255. begin
  256. //charge la page
  257.   Sleep(500);
  258.   Line := GetPage(Address);
  259. // Pour le mode Batch
  260.    if (GetOption('Fichier de log') = 0) then
  261.      beforeUpdate();
  262. // Traduction des champs
  263.   SetArrayLength(listeFR,16);
  264.   SetArrayLength(listeUS,16);
  265.   listeFR[0] := 'Titre Anglais';
  266.   listeUS[0] := 'English Title';
  267.   listeFR[1] := 'Titre Original';
  268.   listeUS[1] := 'Original Title';
  269.   listeFR[2] := 'Titre Franτais';
  270.   listeUS[2] := 'French Title';
  271.   listeFR[3] := 'AnnΘe';
  272.   listeUS[3] := 'Year';
  273.   listeFR[4] := 'Pays';
  274.   listeUS[4] := 'Country';
  275.   listeFR[5] := 'RΘalisateur';
  276.   listeUS[5] := 'Director';
  277.   listeFR[6] := 'InterprΦte';
  278.   listeUS[6] := 'Actor';
  279.   listeFR[7] := 'Producteur';
  280.   listeUS[7] := 'Producer';
  281.   listeFR[8] := 'Genre';
  282.   listeUS[8] := 'Genre';
  283.   listeFR[9] := 'DurΘe';
  284.   listeUS[9] := 'Duration';
  285.   listeFR[10] := 'ScΘnario';
  286.   listeUS[10] := 'Synopsis';
  287.   listeFR[11] := 'notes';
  288.   listeUS[11] := 'grades';
  289.   listeFR[12] := 'moyenne';
  290.   listeUS[12] := 'average';
  291.   listeFR[13] := 'critiques';
  292.   listeUS[13] := 'reviews';
  293.   listeFR[14] := 'textes';
  294.   listeUS[14] := 'texts';
  295.   listeFR[15] := 'Visiteurs';
  296.   listeUS[15] := 'Visitors';
  297.  
  298. // Titre Traduit
  299.   if CanSetField(fieldTranslatedTitle) then
  300.     MonSetField(fieldTranslatedTitle, formatTitre(findInfo('titrefiche" height="80px">', '</td>', Line,'0'),GetOption('Casse Choisie')));
  301. // Titre Original
  302.    if CanSetField(fieldOriginalTitle) then
  303.    begin
  304.       titre_original := StringReplace(findInfo(retourneElement(1), '</tr>', Line,'0'), '    ', '');
  305.       titre_anglais  := StringReplace(findInfo(retourneElement(0), '</tr>', Line,'0'), '    ', '');
  306.       autre_titre    := StringReplace(findInfo(retourneElement(2), '</tr>', Line,'0'), '    ', '');
  307. // tests les titres :
  308.       if (GetOption('Choix titres originaux') = 0) then
  309.       begin
  310.         if titre_original <> '' then
  311.           les_titres := deleteAsianChar(titre_original)
  312.         else if titre_anglais <> '' then
  313.          les_titres := titre_anglais
  314.         else if autre_titre <> '' then
  315.          les_titres := autre_titre;
  316.       end else
  317.       if (GetOption('Choix titres originaux') = 1) then
  318.       begin
  319.         if titre_anglais <> '' then
  320.          les_titres := titre_anglais
  321.         else if titre_original <> '' then
  322.          les_titres := deleteAsianChar(titre_original)
  323.         else if autre_titre <> '' then
  324.          les_titres := autre_titre;
  325.      end;
  326.      MonSetField(fieldOriginalTitle, formatTitre(Trim(les_titres),GetOption('Casse Choisie')));
  327.    end;
  328. // AnnΘe
  329.    if CanSetField(fieldYear) then
  330.       MonSetField(fieldYear, StringReplace(findInfo(retourneElement(3), '</tr>', Line,'0'), '    ', ''));
  331. // Pays
  332.    if CanSetField(fieldCountry) then
  333.    begin
  334.       Value := findInfo(retourneElement(4), '</tr>', Line,'-1');
  335.       Value := StringReplace(Value, #13#10, ', ');
  336.       Value := StringReplace(Value, '    ', '');
  337.       MonSetField(fieldCountry, deleteEnd(Value, ', , '));
  338.    end;
  339. // RΘalisateur
  340.    if CanSetField(fieldDirector) then
  341.    begin
  342.       Value := formatTitre(StringReplace(findInfo(retourneElement(5), '</tr>', Line,'0'), '    ', ''),GetOption('Casse Choisie'));
  343.       Value := StringReplace(Value, ' - ', ', ');
  344.       MonSetField(fieldDirector, deleteEnd(Value, ', '));
  345.    end;
  346. // Acteurs
  347.    if CanSetField(fieldActors) then
  348.    begin
  349.       Value := findInfo(retourneElement(6), '</table>', Line,'1');
  350.       Value := StringReplace(Value, '<i>', ' (');
  351.       Value := StringReplace(Value, '</i>', '), ');
  352.       Value := StringReplace(Value, ' (), ', ', ');
  353.       Value := StringReplace(Value, '    ', '');
  354.       Value := coupeInfo('<div class="titrecol">', '</div>', '', Value);
  355.       Value := StringReplace(Value, ' - ', '');
  356.       Value := StringReplace(Value, '   ', ' ');
  357.       Value := StringReplace(Value, '  ', ' ');
  358.       Value := deleteEnd(formatTitre(Value,GetOption('Casse Choisie')), ',')+'.';
  359.       if Value <> '.' then
  360.          MonSetField(fieldActors, Value);
  361.    end;
  362. // Producteur
  363.    if CanSetField(fieldProducer) then
  364.    begin
  365.       Value := formatTitre(StringReplace(findInfo(retourneElement(7), '</tr>', Line,'0'), '    ', ''),GetOption('Casse Choisie'));
  366.       Value := StringReplace(Value, ' - ', ', ');
  367.       MonSetField(fieldProducer, deleteEnd(Value, ', '));
  368.    end;
  369. // Adresse Web
  370.   if CanSetField(fieldURL) then
  371.       SetField(fieldURL, Address);
  372. // DurΘe
  373.    if CanSetField(fieldLength) then
  374.       MonSetField(fieldLength, findInfo(retourneElement(9), 'min', Line,'0'));
  375. // Genre
  376.    if CanSetField(fieldCategory) then
  377.    begin
  378.       Value := findInfo(retourneElement(8), '</tr>', Line,'-1');
  379.       Value := StringReplace(Value, #13#10, ', ');
  380.       Value := StringReplace(Value, '    ', '');
  381.       MonSetField(fieldCategory, formatTitre(deleteEnd(Value, ', , '),GetOption('Casse Choisie')));
  382.    end;
  383. // Image
  384.    if CanSetPicture then
  385.    begin
  386.      Sleep(500);
  387.      if findInfo(urlImage, '"', Line,'0') <> '' then
  388.        MonGetPicture(urlBase+urlImage+findInfo(urlImage, '"', Line,'0'))
  389.      else if findInfo(urlImage2, '"', Line,'0') <> '' then
  390.        MonGetPicture(urlBase+urlImage2+findInfo(urlImage2, '"', Line,'0'));
  391.    end;
  392. // L'histoire
  393.    if CanSetField(fieldDescription) then
  394.    begin
  395.      Value := findInfo(retourneElement(10), '</div>', Line,'0');
  396.      Value := StringReplace(Value, '    ', '');
  397.      if pos('This text does not yet exist, please click on ', Value) = 0 then
  398.         MonSetField(fieldDescription, Value);
  399.    end;
  400. // Critiques et notes
  401.    if pos('noscritiques.html', Line) <> 0 then
  402.    begin
  403.      //charge la page
  404.      Sleep(500);
  405.      Line := GetPage(Address+'noscritiques.html');
  406.      Note1 := '0';
  407.      Note2 := '0';
  408.      Value2 := AnsiUpperCase(retourneElement(12))+' :'+#13#10#13#10;
  409.      Value := findInfo('"indpic">'+retourneElement(11)+':', '</b>', Line,'0');
  410.      Value2 := Value2+'Cinemasie : '+Value+' '+retourneElement(11)+', ';
  411.      Value := findInfo('"indpic">'+retourneElement(12)+':', '</b>', Line,'0');
  412.      Note1 := Value;
  413.      Value2 := Value2+retourneElement(12)+' : '+Value+'/5 ';
  414.      if pos('voscritiques.html', Line) <> 0 then
  415.      begin
  416.        Value2 := Value2+#13#10+retourneElement(15);
  417.        Value := findInfo('<td>'+retourneElement(11)+':', '</b>', Line,'0');
  418.        Value2 := Value2+' : '+Value+' '+retourneElement(11)+', ';
  419.        Value := findInfo('<td>'+retourneElement(12)+':', '</b>', Line,'0');
  420.        Note2 := Value;
  421.        Value2 := Value2+retourneElement(12)+' : '+Value+'/5 ';
  422.      end;
  423.      Value := Value2;
  424.      if pos('<tr class="chapeautexte">', Line) <> 0 then
  425.      begin
  426.        Value := Value+#13#10#13#10+AnsiUpperCase(retourneElement(13))+' :'+#13#10#13#10;
  427.        Value2 := findInfo('<tr class="chapeautexte">', '</center>', Line,'-1');
  428.        Value2 := StringReplace(Value2, '|', '-');
  429.        Value2 := StringReplace(Value2, '    ', '');
  430.        Value2 := StringReplace(Value2, #13#10#13#10#13#10#13#10, #13#10#13#10);
  431.        Value2 := StringReplace(Value2, #13#10#13#10#13#10, #13#10);
  432.        Value := Value+Value2;
  433.      end;
  434.      if CanSetField(fieldComments) then
  435.        SetField( fieldComments,Value);
  436.      if CanSetField(fieldRating) then
  437.        MonSetField(fieldRating, calculMoyenne(Note1, Note2));
  438.    end;
  439. // Pour le mode Batch
  440.   if (GetOption('Fichier de log') = 0) then
  441.     afterUpdate();
  442. // Affichage des titres si original et traduit identique
  443.   titreDouble(GetOption('Titre en double'));
  444.  
  445. end;
  446.  
  447. //------------------------------------------------------------------------------
  448. // CALCUL DE LA NOTE
  449. //------------------------------------------------------------------------------
  450.  
  451. function calculMoyenne(Note1, Note2 : String) : string;
  452. begin
  453.     if (Note1 = '0') and (Note2 = '0') then
  454.       result := ''
  455.     else if (Note1 = '0') then
  456.       result := FloatToStr(StrToFloat(Note2)+StrToFloat(Note2))
  457.     else if (Note2 = '0') then
  458.       result := FloatToStr(StrToFloat(Note1)+StrToFloat(Note1))
  459.     else
  460.       result := FloatToStr(StrToFloat(Note1)+StrToFloat(Note2));
  461. end;
  462.  
  463. //------------------------------------------------------------------------------
  464. // TROUVE LE BON TITRE SI LE PREMIER N'EST PAS LE BON
  465. //------------------------------------------------------------------------------
  466.  
  467. procedure trouveTitle(title : String);
  468. var
  469.    oK, couple, annee, titre, adresse : String;
  470. begin
  471.    for i:=0 to listeResultat.Count-1 do
  472.    begin
  473.      couple := listeResultat.GetString(i);
  474.      annee := copy(couple,0,pos('|',couple)-1);
  475.      delete(couple, 1, length(annee)+1);
  476.      titre := copy(couple,0,pos('|',couple)-1);
  477.      delete(couple, 1, length(titre)+1);
  478.      HTMLDecode(titre);
  479.      adresse := copy(couple,0,length(couple));
  480.      delete(couple, 1, length(adresse)+1);
  481.      oK := compareTitle(title,titre);
  482.      if oK = 'OK' then
  483.      begin
  484.        AnalysePageFilm(adresse);
  485.        exit;
  486.      end;
  487.    end;
  488.    listeResultat.Free;
  489.  
  490. end;
  491.  
  492. //------------------------------------------------------------------------------
  493. // COMPARE LE TITRE PASSE ET LE TITRE TROUVE
  494. //------------------------------------------------------------------------------
  495.  
  496. function compareTitle(titleAllo, title : String) : String;
  497. begin
  498.      title := supprimeLesAccents(trim(AnsiLowerCase(title)));
  499.      titleAllo := supprimeLesAccents(trim(AnsiLowerCase(titleAllo)));
  500.      if (title = titleAllo) then
  501.      begin
  502.        result := 'OK';
  503.      end else
  504.      begin
  505.        result := 'KO';
  506.      end;
  507. end;
  508.  
  509. //------------------------------------------------------------------------------
  510. // PROGRAMME PRINCIPAL
  511. //------------------------------------------------------------------------------
  512.  
  513. begin
  514.   if CheckVersion(3,5,0) then
  515.   begin
  516.     if GetOption('Mise α jour') = 0 then
  517.     begin
  518.        execMenuMAJ(VersionScript,NomScript);
  519.        exit;
  520.     end;
  521.     NomFilm := recupTitreRecherche(GetOption('Recherche sur le titre'));
  522.     if (GetOption('Fichier de log') = 0) and (premiereExecution = 0) then
  523.     begin
  524.       batch(NomScript);
  525.       AddToLog('Les films ayant ΘtΘ mis α jour sont maintenant cochΘs');
  526.     end;
  527.     if (GetOption('Type de Lancement') = 0) then
  528.     begin
  529.       if Input(NomScript+' by ScorEpioN', 'Entrez le titre du film :', NomFilm) then
  530.       begin
  531.         if Pos(urlDomain, NomFilm) > 0 then
  532.         begin
  533.               AnalysePageFilm(NomFilm);
  534.         end else
  535.         begin
  536.           //remplace les caractΦres accentuΘs
  537.           MovieName := NomFilm;
  538.           NomFilm := supprimeLesAccents(NomFilm);
  539.           NomFilm := StringReplace(NomFilm, ' ', '+');
  540.           NomFilm := urlBaseFRUS()+urlSearch+ UrlEncode(MovieName);
  541.           AnalyzePage(NomFilm);
  542.         end;
  543.       end;
  544.     end else
  545.     if (GetOption('Type de Lancement') = 3) then
  546.     begin
  547.       if (premiereExecution = 0) then
  548.       begin
  549.         premiereExecution := -1;
  550.         if (ShowConfirmation('Vous allez executer le script sans confirmation, cliquer sur ''''OUI'''' pour continuer') = False) then
  551.            exit;
  552.       end;
  553.       NomFilm := GetField(fieldURL);
  554.       if Pos(urlDomain, NomFilm) > 0 then
  555.          AnalysePageFilm(NomFilm);
  556.     end else
  557.     begin
  558.       MovieName := NomFilm;
  559.       NomFilm := supprimeLesAccents(NomFilm);
  560.       NomFilm := StringReplace(NomFilm, ' ', '+');
  561.       if (premiereExecution = 0) then
  562.       begin
  563.           premiereExecution := -1;
  564.           if (ShowConfirmation('Vous allez executer le script sans confirmation, cliquer sur ''''OUI'''' pour continuer') = True) then
  565.           begin
  566.             AnalyzePage(urlBaseFRUS()+urlSearch+ UrlEncode(MovieName));
  567.           end else
  568.             exit;
  569.       end else
  570.       begin
  571.         NomFilm := urlBaseFRUS()+urlSearch+ UrlEncode(MovieName);
  572.         AnalyzePage(NomFilm);
  573.       end;
  574.     end;
  575.   end else
  576.     ShowMessage('Ce script requiert une version plus rΘcente de Ant Movie Catalog (au moins la version 3.5.0)');
  577. end.
  578.